import { BaseEntity, Column, Entity, PrimaryGeneratedColumn, Tree,TreeLevelColumn,TreeParent,TreeChildren,JoinColumn } from "typeorm";
/**
 * 创建菜单表
CREATE TABLE `sys_menu` (
  `menu_id` INT AUTO_INCREMENT PRIMARY KEY,
  `pid` INT NOT NULL DEFAULT 0 COMMENT '父菜单ID',
  `title` VARCHAR(50) NOT NULL COMMENT '菜单名称',
  `icon` VARCHAR(30) DEFAULT NULL,
  `path` VARCHAR(100) DEFAULT '' COMMENT '路由地址',
  `component` VARCHAR(100) DEFAULT NULL COMMENT '组件路径',
  `sort` FLOAT NOT NULL COMMENT '排序',
  `type` TINYINT NOT NULL COMMENT '1目录 2菜单 3按钮',
  `visible` BOOLEAN DEFAULT 1 COMMENT '是否显示',
  `permission` VARCHAR(50) DEFAULT NULL COMMENT '权限标识'
);
 */
@Entity("setting_sys_menus")
// @Tree("materialized-path")
export class SettingSysMenu extends BaseEntity{
    @PrimaryGeneratedColumn()
    menu_id: number
    @Column({
        type: 'int',
        default:0
    })
    pid: number
    @Column({
        type: 'int',
        default:0
    })
    level: number
    @Column({
      type: 'varchar',
      length: 50
    })
    title: string

    @Column({
      type: 'varchar',
      length: 30
    })
    icon: string

    @Column({
      type: 'varchar',
      length: 100
    })
    path: string

    @Column({
      type: 'varchar',
      length: 100
    })
    component: string

    @Column({
      type: 'float',
      default: 0
    })
    sort: number

    @Column({
      type: 'tinyint',
      default: 0
    })
    type: number

    @Column({
      type: 'boolean',
      default: true
    })
    visible: boolean
    
    @Column({
      type: 'varchar',
      length: 50
    })
    permission: string

}